/* RURAL CLAIM-MAKING PRACTICE, ANALYSIS FOR "GEOGRAPHY OF CITIZENSHIP PRACTICE" */	

clear
set more off

use  "geo_citizen_practice_rural_data.dta"


* SECTION 3: CONTEXT & METHODS
******************************

* Table 1. Socioeconomic Standing in Urban Slums and Rural Villages (Rural sample only)  

  * Below poverty line (% with card): bpl_have
  * Per capita monthly HH income
	gen pc_hhinc_month =  hhinc_month/hh_size
	
  * Asset ownership
  * Generating assets index 0-7: motorcycle, car, TV, radio, refrigerator, gas stove, and mobile phone
	gen assets_index = ass_motor + ass_car + ass_tv + ass_rad + ass_freez + ass_gas + ass_mob
	sum assets_index
	
  * Creating Quintiles of assets_index 
	xtile assets_quint =  assets_index, nq(5)
  * Defining first quintile
	gen assetsQ1 = 0
	replace assetsQ1 = 1 if assets_quint == 1
	
	gen assetsQ5 = 0
	replace assetsQ5 = 1 if assets_quint == 5
	
    /* Definitions 
	 "Asset poor" = those in first quintile of assets index
     "Asset rich" = those in the fifth quintile */
	
  * Education (years): edu
   sum edu
   * (no formal schooling = ed_none)

  * Scheduled Caste (%): caste_sc
    sum caste_sc

  * Scheduled Tribe (%): caste_st  
	sum caste_st
	
  * Muslim (%): 
	gen muslim = 0
	replace muslim = 1 if religion == 2
	sum muslim

  * Female: gender = 1
    tab gender


* CLAIM-MAKING INCIDENCE (discussion in section 3)
  * Any reported claim-making (direct or mediated + collective or selective goods, full definitions in Kruks-Wisner 2018): CM_incidence

  sum CM_incidence

  * CM by indicators of poverty & socioeconomic standing
		foreach povind in assetsQ1 landless landQ1 ed_none caste_sc caste_st muslim gender{
		sum CM_incidence if `povind' == 1  
		}


		
* SECTION 4: UNEVEN EXPECTATIONS
*********************************

* TABLE 2. Expectations of Government Responsiveness (Rural)
  /* govt_resp ("If you yourself (alone) try to contact a government official, will you be ignored or get a response?)"
    0 = ignored/no response; 1= get a response */

  * Including missing data (-777)  and "don't know" (-999)
  tab govt_resp_ex

  * Expect govt response by indicators of poverty & socioeconomic standing 

		foreach povind in assetsQ1 ed_none caste_sc caste_st muslim gender{
		tab govt_resp_ex if `povind' == 1  
		}

* Testing differences in means in expectations of response (govt_resp = 1 = expect response)

		foreach povind in assetsQ1 ed_none caste_sc caste_st muslim gender{
		prtest govt_resp, by(`povind')  
		}


		
* SECTION 5. LOCAL PRESENCE & USE OF INTERMEDIARIES 
***************************************************

* TABLE 3: Reported Presence of Informal Political Brokers
  * Reported presence of political brokers in village = fixers (1 reports presence, 0 does not report presence)
  
  * Including missing data (-777)  and "don't know" (-999)
  tab fixers_ex
  
  * Reporing presence of brokers, by indicators of poverty & socioeconomic standing 

		foreach povind in assetsQ1 ed_none caste_sc caste_st muslim gender{
		tab fixers_ex if `povind' == 1  
		}

* Testing differences in means in reporting presence of brokers (binary)

		foreach povind in assetsQ1 ed_none caste_sc caste_st muslim gender{
		prtest fixers, by(`povind')  
		}

		
* Contacting brokers (discussion in Section 5)

  * Creating new variable "fixer_contact" where 1 = contacted and 0 = did not contact
  * Include missing data (-777)  and "don't know" (-999)
	 * using "appr_none_ex" for has not approached any kind of fixer (1 = did NOT approach, 0 = DID approach) 
	
	rename appr_none_ex fixer_nocontact
	replace fixer_nocontact = 1 if fixers == 0
	rename fixer_nocontact fixer_contact
	recode fixer_contact (1=0) (0=1)

  tab fixer_contact
		
* Contact fixer by indicators of poverty of poverty & socioeconomic standing 
		foreach povind in assetsQ1 ed_none caste_sc caste_st muslim gender{
		tab fixer_contact if `povind' == 1  
		}
			
* Testing differences in meansin contacting fixers 
	* Creating binary variable for contacting (dropping missing data and "don't know" responses)
		gen fixer_contact_bin = fixer_contact
		recode fixer_contact_bin ("-777"=0)
		recode fixer_contact_bin ("-999"=0)

		foreach povind in assetsQ1 ed_none caste_sc caste_st muslim gender{
		prtest fixer_contact_bin, by(`povind')  
		}
		

		
* Section 6. WHY MIGHT CITIZENSHIP PRACTICE DIVERGE FROM TOWN TO COUNTRY? 
********************************************************************************

* Expect govt response by level of education

		foreach povind in ed_none ed_prim ed_sec ed_higher{
		tab govt_resp_ex if `povind' == 1  
		}

* TABLE 4. Table 4. Informality and Residential Stability
 * Landownership
  tab landless
  tab govt_resp_ex if landless == 1
  tab fixers_ex if landless == 1
 
 * Migration (binary, if member of HH has lived outside village more than 30 days/year): MIG
  tab MIG
  tab govt_resp_ex if MIG == 1
  tab fixers_ex if MIG == 1
  
* Distance to a town (dist_town)
	xtile distance_quint =  dist_town, nq(5)

* Defining first and last quintiles for distance
	gen distanceQ1 = 0
	replace distanceQ1 = 1 if distance_quint == 1

	gen distanceQ5 = 0
	replace distanceQ5 = 1 if distance_quint == 5

* Expect Govt Response by distance 
		foreach povind in distanceQ1 distanceQ5{
		sum govt_resp if `povind' == 1  
		}

		
		
* SECTION 7. TERRAIN OF THE STATE IN NORTHERN INDIA
********************************************************************************

* Frequency of visits from politicians: partyvis_frq
tab partyvis_frq

* Reported contact with politcians and party workers: contact_party
tab contact_party




